package com.ruoyi.payMent.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.payMent.mapper.RefundsMapper;
import com.ruoyi.payMent.domain.Refunds;
import com.ruoyi.payMent.service.IRefundsService;

/**
 * 退款记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-24
 */
@Service
public class RefundsServiceImpl implements IRefundsService 
{
    @Autowired
    private RefundsMapper refundsMapper;

    /**
     * 查询退款记录
     * 
     * @param refundsId 退款记录主键
     * @return 退款记录
     */
    @Override
    public Refunds selectRefundsByRefundsId(Long refundsId)
    {
        return refundsMapper.selectRefundsByRefundsId(refundsId);
    }

    /**
     * 查询退款记录列表
     * 
     * @param refunds 退款记录
     * @return 退款记录
     */
    @Override
    public List<Refunds> selectRefundsList(Refunds refunds)
    {
        return refundsMapper.selectRefundsList(refunds);
    }

    /**
     * 新增退款记录
     * 
     * @param refunds 退款记录
     * @return 结果
     */
    @Override
    public int insertRefunds(Refunds refunds)
    {
        refunds.setCreateTime(DateUtils.getNowDate());
        return refundsMapper.insertRefunds(refunds);
    }

    /**
     * 修改退款记录
     * 
     * @param refunds 退款记录
     * @return 结果
     */
    @Override
    public int updateRefunds(Refunds refunds)
    {
        refunds.setUpdateTime(DateUtils.getNowDate());
        return refundsMapper.updateRefunds(refunds);
    }

    /**
     * 批量删除退款记录
     * 
     * @param refundsIds 需要删除的退款记录主键
     * @return 结果
     */
    @Override
    public int deleteRefundsByRefundsIds(Long[] refundsIds)
    {
        return refundsMapper.deleteRefundsByRefundsIds(refundsIds);
    }

    /**
     * 删除退款记录信息
     * 
     * @param refundsId 退款记录主键
     * @return 结果
     */
    @Override
    public int deleteRefundsByRefundsId(Long refundsId)
    {
        return refundsMapper.deleteRefundsByRefundsId(refundsId);
    }
}
